package com.zhentao.controller;

import com.zhentao.pojo.Classes;
import com.zhentao.service.ClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

//ssm注解的整合入门案例
@Controller
public class Helle {
    //业务层
    @Autowired
    private ClassesService classesService;
    //处理请求的方法

//    @RequestMapping("/hello/first")
//    @ResponseBody
//    public String first(){
//        return "hello word";
//    }
@RequestMapping("/hello/first")
@ResponseBody
public List<Classes> first(){
    List<Classes> list=classesService.findAll();
    return list;
}

}
